package com.codi.api.xxljob;

import com.codi.bus.core.service.impl.LocaldataDividentsService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 分红同步
 * 0 30 9 * * ?
 * @date 18-6-29 下午4:43
 */
@Slf4j
@Component
@JobHandler("dividendHandler")
public class DividendHandler extends IJobHandler {

    @Resource
    private LocaldataDividentsService localdataDividentsService;


    @Override
    public ReturnT<String> execute(String s) throws Exception {
        log.info("Dividend job");


        //分红  每日全量更新  调恒生
        localdataDividentsService.addDividents();
        XxlJobLogger.log("Dividend-JOB, success");

        return SUCCESS;
    }
}
